#ifndef FUNC_WIDGET_H
#define FUNC_WIDGET_H

#include <QWidget>
#include <QLabel>
#include <QLineEdit>
#include <QHBoxLayout>
#include <QObject>
#include <iostream>
#include "ECanVci.h"

struct can_id_part
{
    unsigned int cmd:12;
    unsigned int dst:8;
    unsigned int src:9;
    unsigned int rsvd:3;
};

union can_id_all
{
    unsigned int all;
    struct can_id_part part;
};

class func_widget : public QWidget
{
    Q_OBJECT
public:
    func_widget(QWidget* parent);

private slots:
    void eth_connect(bool rsvd);
    void eth_disconnect(bool rsvd);
    void fight_parm_set(bool rsvd);
    void reset(bool rsvd);
    void slave_adaptor_parm_set(bool rsvd);
    void slave_adaptor_parm_store(bool rsvd);
    void slave_adaptor_parm_init(bool rsvd);
    void master_adaptor_parm_set(bool rsvd);
    void master_adaptor_parm_store(bool rsvd);
    void master_adaptor_parm_init(bool rsvd);
    void withdraw(bool rsvd);
    void ada_parm_query(bool rsvd);
    void ada_parm_store(bool rsvd);
    void ada_parm_init(bool rsvd);
    void operate_parm_query(bool rsvd);
    void checkbox_checked_0(int state);
    void checkbox_checked_1(int state);
    void checkbox_checked_2(int state);
    void checkbox_checked_3(int state);
    void start_pump_tx(bool rsvd);
    void output_operate(int cmd);
    void set_fight_operate_flag(int cmd);
    void enter_debug(bool state);
    void exit_debug(bool state);
    void hot_standby(bool rsvd);
    void cold_standby(bool rsvd);

    void output_strong_light(bool rsvd);
    void output_red_light(bool rsvd);
    void output_week_1_light(bool rsvd);
    void output_week_2_light(bool rsvd);
    void stop_light(bool rsvd);

    void enter_week_light_mode(bool rsvd);
    void exit_week_light_mode(bool rsvd);
    void udp_start_connect(bool rsvd);
    void udp_exec_disconnect(bool rsvd);
    void udp_start_parm_upload(bool rsvd);
    void slave_adaptor_parm_load(bool rsvd);

signals:
    void disable_can_connect_button(bool state);

};

extern unsigned int can_connect_finish;



#endif // FUNC_WIDGET_H
